import Compile from './module/Compile';
import Observe from './module/Observe';

function Vue(options) {
  this.data = options.data;
  // 事件方法
  this.methods = options.methods;
  // 需要监听的任务列表
  this.watcherTask = {};
  const data = this.data;
  Observe(data, this);
  const id = options.el;
  const dom =new Compile(document.getElementById(id),this);
  // 编译完成后，将dom返回到app中
  document.getElementById(id).appendChild(dom);
}

var vm = new Vue({
  el: 'app',
  data: {
    text: 'hello Vue',
    abc: '124',
    tmp: `<div><a href="https://www.baidu.com">百度</a>lbs</div>`
  },
  methods: {
    onClickHandle (e) {
      console.log(e)
      console.log(this)
      this.text = "wedewdewdew"
    }
  }
});

console.log(vm)